#pragma once
#if defined(R69_BOARD)
typedef enum __boart_pin_map_t
{
    CHARGING_PLUGIN_PIN = 3,
    CHARGING_FULL_PIN = 4,
    HEART_RATE_RESET_PIN = 5,
    HEART_RATE_INTERRUPT_PIN = 6,
    HEART_RATE_EN_PIN = 7,
    GSENSOR_INT_PIN = 8,
    GSENSOR_CLOCK_PIN = 9,
    GSENSOR_DATA_PIN = 10,
    FLASH_CLOCK_PIN = 11,
    FLASH_MOSI_PIN = 12,
    FLASH_MISO_PIN = 13, //?  SPI_MISO
    FLASH_CS_PIN = 14,
    OLED_POWER_PIN = 15,
    OLED_DC_PIN = 16,
    OLED_CLOCK_PIN = 17,
    OLED_DATA_PIN = 19,
    OLED_CS_PIN = 18,
    TOUCHPAD_RESET_PIN = 20,
    TOUCHPAD_INT_PIN = 21,
    MOTOR_PIN = 22,
    PCBA_TEST_DATA_PIN = 23,
    PCBA_TEST_CLOCK_PIN = 24,
    TOUCHPAD_DATA_PIN = 25,
    TOUCHPAD_CLOCK_PIN = 26,
    HEART_RATE_CLOCK_PIN = 30,
    HEART_RATE_DATA_PIN = 31,

    TWI_DEVICE_CLOCK = HEART_RATE_CLOCK_PIN,
    TWI_DEVICE_DATA = HEART_RATE_DATA_PIN,

} boart_pin_map_t;
#define G_I2C_CLK GSENSOR_CLOCK_PIN
#define G_I2C_DAT GSENSOR_DATA_PIN

#define SPI_OPERATING_FREQUENCY (0x02000000UL << (uint32_t)Freq_8Mbps) /*!< Slave clock frequency. */
#define TIMEOUT_COUNTER 0x3000UL                                       /*!< timeout for getting rx bytes from slave */

#define FLASH_SPIX NRF_SPI0
#define OLED_SPIX NRF_SPI1
#define OLED_SPIXM NRF_SPIM1
#define GSENSOR_SPI NRF_SPI2

#define BUTTON_1_ACTIVE_STATE APP_BUTTON_ACTIVE_HIGH
#define BUTTON_1_PULL_CFG NRF_GPIO_PIN_NOPULL

// Low frequency clock source to be used by the SoftDevice
#define NRF_CLOCK_LFCLKSRC                                                                                                                                                                             \
    {                                                                                                                                                                                                  \
        .source = NRF_CLOCK_LF_SRC_XTAL, .rc_ctiv = 0, .rc_temp_ctiv = 0, .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM                                                                           \
    }

// bootloader使用按键
// #define BOOTLOADER_USE_BUTTON_PIN (BUTTON_PIN_NUM_1)
// #define BOOTLOADER_USE_BUTTON_PIN_PULL (BUTTON_1_PULL_CFG)
// #define BOOTLOADER_USE_BUTTON_PIN_SENSE (BUTTON_1_ACTIVE_STATE)
#else
#error not R69_BOARD
#endif
